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)
- 2.2 does not compile on Fedora 40 HOT 4
- [question] How is z88dk making it possible to parallely build several targets sharing some code? HOT 3
- [bug?] Z88DK versions from the same date: Linux version fails while Windows version is OK HOT 7
- [bug][zx81][wrx] When compiling for zx81 with wrx I now get `undefined symbol: hrg_phase` HOT 11
- Thank you 🙂 HOT 1
- msys2 issues: clang64 error compiling and compiler path errors HOT 3
- [feature] Support for Olivetti m10 (clone of m100) HOT 22
- (z80asm) Compile issue on msys2
- ASSERT on Z80asm HOT 2
- Compile error today (worked yesterday) HOT 1
- MacOS - zsdcc binary is r14210 HOT 3
- appmake +zx colliding with binaries of previous builds
- TMS9918 graphics improvements HOT 6
- [question][ti] What is the meaning of "Warning: Use of numbers in the variable name is not certain to work on all calculators!" ? HOT 2
- (sccz80) Support static __far data
- [zx81][feature] WRX96 and/or WRX128 with centered display? HOT 1
- sccz80 - lhs constant comparison HOT 6
- 8085 - l_eq l_ne operator optimisation HOT 5
- (classic) KC and ZX81 (384 rows) graphics not fully ix independent HOT 8
- Unexpected z80asm macro formal parameter behavior?
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.