Liste des Groupes | Revenir à cl c |
Muttley@DastardlyHQ.org writes:Humm... However, one can choose to carve out allocations from the region? Actually, this basically reminds me of my older region allocator code. So, this is basically dynamic within our defined region, so to speak. However, back in the day, I would try to recover from dynamic malloc failures... Just for testing the robustness of my system. Fwiw, here is my old region code:On Mon, 09 Jun 2025 18:33:38 GMTThat's a problem with host not being suitable for java, if that
scott@slp53.sl.home (Scott Lurndal) wibbled:Bonita Montero <Bonita.Montero@gmail.com> writes:>Am 09.06.2025 um 17:53 schrieb Scott Lurndal:>Bonita Montero <Bonita.Montero@gmail.com> writes:>Am 09.06.2025 um 16:01 schrieb Scott Lurndal:>
>Have you ever written real-world production code? Like an operating>
system, where allocation failures should -never- result in an
inability to recover.
If you need an allocation to proceed and it fails you can't recover.
That's your problem caused by poor design and implementation.
That's how 100% of all programs that deal with bad_alloc are designed.
>Exacerbated by the propensity for you to use C++ features that require>
dynamic allocation where other forms of data structures are more suitable.
When dynamic allocation is needed it is needed.
And there are many ways to handle it that don't include throwing
bad_alloc when the system is unable to provide additional address
space, memory or backing store.
>
Allocating major data structures at application start (perhaps using a
pool allocator) and crafting your algorithms such that they
don't require infinite memory is a good start.
Ugh. Then you end up like the Java JVM - grabbing boatloads of memory that
causes huge startup delays and can often cause the machine to do lots of
swapping and/or slow everything else down to treacle.
is the behavior you are seeing. I've not seen that in production
java-based applications that are competently developed.
For C/C++, one generally allocates page-aligned regions with mmap, eschewing
granular allocation methods such as new/delete/malloc.
Les messages affichés proviennent d'usenet.