Comments (5)
Wow.. now I understood the error message I was getting.
You have a few errors:
You're trying to free memory that's not heap memory. Don't do that.
You're trying to free the inside of a block of memory. When you have in fact allocated a block of memory, you can only free it from the pointer returned by malloc. That is to say, only from the beginning of the block. You can't free a portion of the block from the inside.
http://stackoverflow.com/questions/20297524/c-free-invalid-pointer
from citrine.
Yes this needs some work.
from citrine.
I just tried something after meditating over this issue. I found that ctr_build_string accepts strings on the heap and stack, and that is why it trigged free invalid pointer error. So, this is what I did and it passed test cases. I found every function inside base.c file that calls ctr_build_string and for anyone that has string on the heap I added the below:
ctr_object* result;
result = return ctr_build_string(dest, nlent);
free(dest);
return result;
Please go through and comment. I tend to spend more time studying and assimilating citrine source code.
from citrine.
maybe a macro would be better for this?
from citrine.
I think this issue is no longer relevant, most/all memory issues in String, File, Map and Array have been fixed. I only need to test Nil, Object, Boolean, Number, Blocks and the system library but these are low risk and easy to test.
from citrine.
Related Issues (20)
- Scrolling screens
- Multiplayer support
- 3D game support
- Automatic resize images and window
- Hover event
- Scientific Plugin
- On-screen controls (for Android/iOS)
- Optional line numbers in edit fields
- Optional code highlighting in edit fields
- Single line edit fields
- Browser
- Integrated payment options
- Support for mesh networks
- FFI
- SQLite Plugin
- Export to MacOS
- Deep integration with speech synthesizer HOT 1
- Hi-end Video Support
- Basic HTTP Request
- Replacing text from clipboard gives error
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 citrine.