Comments (5)
So it's obviously the heap size:
{
unsigned int total, largest;
mallinfo(&total, &largest);
printf("Heap size %u largest block %u\n",total, largest);
}
Heap size 30045 largest block 30045 bdos 59398
8192 bytes read
8192 bytes write
Heap size 21851 largest block 21851 bdos 59398
8192 bytes read
8192 bytes write
Heap size 13657 largest block 13657 bdos 59398
8192 bytes read
8192 bytes write
Heap size 5463 largest block 5463 bdos 59398
out of memory
By default it's meant to use 3/4 of the free memory between _bss_tail to the stack pointer. It's obviously not, and the override to set the top of the heap isn't working either.
I'll sort it out.
from z88dk.
It's weird that it's leaking memory as I'm using the same buffer over and over. Another program I have (much more code) hangs using even 1024 buffer. I'll wait until you identify root cause and push fix and test again. Thanks so much for fixing this stuff.
from z88dk.
You're allocating a buffer in main and inside readAndWriteFile which is inside the loop
I didn't spot the one outside initially and I've been chasing down a missing 8k of memory. Doh!
So yeah, the problem with this test case is the memory leak!
from z88dk.
I botched that, hold on, let me fix...
from z88dk.
My bad, let me close this out and get you a real example from a larger app with bdos calls, etc. Anyways, that was a z88dk hacker rank test, hahahaha
from z88dk.
Related Issues (20)
- CMake: Detecting C compiler ABI info - failed
- Contributing with fixes in header files HOT 3
- typo error in src/ticks/disassembler_main.c
- Linux: error compiling test program HOT 1
- Link .map files from other builds instead of clib/startup/crt0? HOT 2
- zcc does not process defc files via -g option
- Wav generation issue + potential solution HOT 14
- `libsrc` build system prone to bricking when interrupted HOT 2
- Any type of file IO causes errors with submit.com HOT 15
- (z80asm) wrong representation of 0.0 in -float=zx81
- Declaring prototype for interrupt handler breaks the handler
- (z80asm) Parse1.c compilation issue for m68k HOT 1
- Far memory support for MSX HOT 11
- [appmake][c128] Capital/Small generated file names HOT 12
- [snap][bug?] How to install the latest z88dk under Ubuntu 21.10? HOT 4
- Compiler and linker hints mess with Eclipse and probably other IDEs HOT 5
- [feature request][devcontainer] No install option HOT 3
- Docker images should be tagged HOT 10
- (z80asm) test fails in SNAPcraft HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from z88dk.