1
0
forked from Alepha/Alepha
Commit Graph

381 Commits

Author SHA1 Message Date
c352117d16 Function adapter which reverses arguments. 2025-09-07 17:40:33 -04:00
e315d63d13 Add some tuple algorithms.
Mostly car/cdr and reversal.
2025-09-07 17:40:00 -04:00
00908187bd Function Composition helpers 2025-09-07 03:45:10 -04:00
4116db0103 Fixup an example in comments on options. 2025-08-27 23:36:20 -04:00
084ee3744f I think gitea likes the license file to live in LICENSE 2025-08-14 16:22:42 -04:00
096c4145e6 Reorganize the license files to avoid confusing gitea. 2025-08-14 16:21:51 -04:00
98b3f414d4 comment explaining the reason for use of Taus88 2025-01-27 16:09:10 -05:00
d008e456c8 Blob based per-thread slab allocator
Uses a fast random generator to decide when to split Blobs.

Closes: #31
2025-01-27 13:23:18 -05:00
8ccd3d0da0 Switch the dead drop to use a circular buffer.
Closes: #16
2025-01-20 14:15:29 -05:00
489f6a097e Merge branch 'master' into slab-allocator
* master:
  Add list size primitive to type lisp.
2024-09-19 00:36:56 -04:00
f4c2e1e044 Add list size primitive to type lisp. 2024-09-19 00:35:59 -04:00
54edf41d96 Fix building of Memory/Buffer.h 2024-09-06 18:09:54 -04:00
5efc8b79f0 Updated thread slab with overflow protection and rewritten. 2024-09-06 17:06:08 -04:00
9717ae49a4 Use fast random to decide when to split Blobs. 2024-09-05 18:48:07 -04:00
3bd236b556 Add fast random facility.
This is a low-memory-overhead and low-cpu-overhead (per generated
bit) random number generator.  The repeat cycle is around 2**88.
Which means around 2**120 bits are available before a cycle.  Which
means that about 2**102 12-bit samples are available before repeats.

This should be more than sufficient for blob rollover purposes.
If 100 million blobs are split per second (absurdly high), then
that's about 2**27 per second.  If run for 30 years, that's
2**30 seconds.  If run across 128 CPUs, that's 2**7 CPUs.  Thus
2**(27+30+7) total samples are required before loop.  This is
2**64 which is WAAAY less than 2**88.  (And this is overly
conservative, as these generators should be one-per-thread...
so we're really much closer to 2**57, not that it matters.)

For this reason, there's no reseed code.  The cycle length of
mt11213b is significantly longer, however, it has a significantly
larger state.  One goal here is to keep the amount of state for
this generator to a single cache line.  As such, if the cycle
length is later shown to be significantly smaller than 2**48
or so, a reseed code path may need to be added.  (This is on
the assumption that the above described intensive run would
run for more than 1 million seconds, or about two weeks.)
2024-09-05 18:44:39 -04:00
6c165b1603 Blob based per-thread slab allocator
This permits "stateless" allocators which grab memory from a
`thread_local Alepha::Blob` instance.  Each allocation
sticks a malloc cookie of type
`std::shared_ptr< Alepha::Blob::StorageReservation >`
just before the base of the allocation.

The allocator object knows that it needs to `reinterpret_cast`
the malloc cookie into a shared pointer and run its destructor.
This causes the Blob's underlying reference counted allocation
to be tied to the lifetime of the allocated memory.  The intent
is to permit cheap allocation in one thread and deallocation
in another.  Each deallocation should be a single atomic
dereference operation.  Each allocation should be (usually) a
bit of pointer arithmetic and a single atomic increment operation.

This, hopefully, eliminates significant thread contention for
the global allocation mechanism between various threads in
an intensive multithreaded situation where each processing
thread thread may independently retire data objects allocated by
a single source.
2024-09-05 18:35:07 -04:00
d4dfe9f90f Major Enum type enhancements
`UnifiedEnum` -- union construction of enumerates

Access the enumerates as constexpr string array

Negation support for binary `Enum`
2024-08-12 16:50:14 -04:00
1c80d27cf3 Add strip_last_t to type lisp. 2024-08-09 03:31:34 -04:00
2d26e70f6b Minor doc spelling fix. 2024-08-08 21:48:32 -04:00
abca951604 Add line-comment filter for streambuf. 2024-08-08 21:35:46 -04:00
da0a737f29 Fix an improperly named module namespace. 2024-08-08 17:21:13 -04:00
322bf65400 Invariant gadget. 2024-08-08 17:19:05 -04:00
307175b616 Fix bug in number printing. 2024-08-08 17:14:08 -04:00
0737afc002 Add line-comment filter for streambuf. 2024-08-08 17:12:33 -04:00
9eaf05c36c Report a handle for ThreadGroup insertions 2024-08-08 04:16:02 -04:00
e232388bdc Permit tuning CPU usage in build from env var 2024-08-02 23:14:47 -04:00
97050bf5f1 Dangit! Forgot the test. 2024-07-29 15:51:50 -04:00
c5d1079deb Flesh out the weight computation for Dropbox 2024-07-25 22:11:23 -04:00
2ee3aba462 Add NamedOperator and NamedComparator.
This permits naming operators via an enhanced enum and then
looking them up.  This is a useful component for quick
development of scripting language functionalities.
2024-07-17 11:45:50 -04:00
308b64fc64 UnifiedEnum -- union construction of enumerates 2024-07-13 16:38:06 -04:00
3c814a53c3 Access the enumerates as constexpr string array 2024-07-13 16:37:25 -04:00
ad053e9175 Negation support for binary Enum 2024-07-13 05:32:57 -04:00
db1b0edff3 Add named comparator support. 2024-07-12 14:55:03 -04:00
0e970762e4 Fix whitespace error. 2024-07-12 14:47:45 -04:00
6a89b18c11 Create C++26(?) emulation of template for
C++26 (I hope) is supposed to have this syntax:

```
template for( const auto &element: aggregate )
{
        ...;
}
```

Thus, I've adjusted this gadget to have a similar name, to enable
simple mechanical code changes.  From Alepha, you'd use it
thus:

```
template_for( aggregate ) <=[&]( const auto &element )
{
        ...;
};
```
2024-07-12 14:35:52 -04:00
a90a1a776e Add a NamedOperator facility to Alepha.
This permits naming operators via an enhanced enum and then
looking them up.  This is a useful component for quick
scripting language functionalities.
2024-07-10 20:28:51 -04:00
6122f3ba80 UA 2024-07-08 17:06:31 -04:00
970cfa3b62 Unify everything to template_for form. 2024-07-05 12:23:26 -04:00
32e6c36570 Rename the template_for header.
C++26 (I hope) is supposed to have this syntax:

```
template for( const auto &element: aggregate )
{
	...;
}
```

Thus, I've adjusted this gadget to have a similar name, to enable
simple mechanical code changes.  From Alepha, you'd use it
thus:

```
template_for( aggregate ) <=[&]( const auto &element )
{
	...;
};
```
2024-07-05 11:59:26 -04:00
b5fb8c76f2 Create C++26(?) emulation of template for. 2024-07-05 11:54:19 -04:00
807311e0dd In this file, Concepts.h should be non-relative 2024-07-05 11:54:09 -04:00
7b449fb3e1 minor edits to Format doc 2024-06-26 18:20:32 -04:00
a8c6780cb9 Enable printing case arguments on failed tests
The `TableTest` mechanism now prints as much detailed information
as it can get about the case arguments in any failed test case.

Git-commit-built-by: Merge branch 'print-test-inputs'
2024-06-14 11:51:00 -04:00
2fa08c821e Add a template binding gadget for type lists
This is useful when the same set of types has to go into a
std::variant, a std::tuple, and perhaps a few other template
lists.

Git-commit-built-by: Merge branch 'make-template'
2024-06-14 11:49:01 -04:00
fa33154064 Add a template binding gadget for type lists. 2024-06-14 11:28:13 -04:00
b44539cab1 Table tests now print argument information about failed cases.
At least they'll print as much information as they can.
Unstreamable input types will just print typeid information.
2024-06-13 18:04:33 -04:00
fc02d1a0c3 Relax the test print debugging rules.
A type which cannot be printed when streamed in "Relaxed"
mode will simply print the typeid and that's it.  This is
opposed to its original behaviour which would be a compile
time error.
2024-06-13 18:03:33 -04:00
33fa7cc711 Expose the stream value adaptor for tests.
This will permit calling this stream adaptor from
various contexts which are test related.
2024-06-13 18:03:12 -04:00
500ad866eb Add an identity which works with TableTest 2024-06-12 16:59:11 -04:00
26eb1b080e Basic support for exception verification in tests
This probably needs to be expanded upon.  The basic functionality
added is to permit a test expectation clause to be a function which
takes some kind of exception type.  That function can then
perform any arbitrary checks and analyses it needs to confirm that
the exception which was caught passes muster for that test case.
2024-06-12 00:08:14 -04:00