-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composed image format: C translation #388
Composed image format: C translation #388
Conversation
{ #category : #'file primitives' } | ||
AbstractComposedImageAccess >> fscanf: file _: format _: varHolder [ | ||
|
||
<doNotGenerate> | ||
^ (format = headFormat) | ||
ifTrue: [ | ||
varHolder contents: (file nextLine substrings: ' ') first ]; | ||
yourself | ||
] | ||
|
||
{ #category : #'file primitives' } | ||
AbstractComposedImageAccess >> fscanf: file _: format _: varHolder1 _: varHolder2 [ | ||
|
||
<doNotGenerate> | ||
^ (format = fieldFormat) | ||
ifTrue: [ | ||
| dataArray | | ||
dataArray := file nextLine substrings: '#:,'. | ||
(dataArray first = '}') ifTrue: [ ^false ]. | ||
varHolder1 contents: dataArray second trimLineSpaces. | ||
varHolder2 contents: dataArray third trimLineSpaces asInteger ]; | ||
yourself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hack 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we implement it for real? (Read based to a format)
|
||
pageSize = getpagesize(); | ||
pageMask = ~(pageSize - 1); | ||
|
||
heapLimit = valign(max(desiredHeapSize, 1)); | ||
heapLimit = valign(max(desiredHeapSize, 1)) + pageSize; // Add 1 page more just in case (G & N) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We started to fix this with Guille, but is not working yet.
…lk-vm into composed-format-c-translation
Now in CI I have this error (about trampolines (?) ) compiling C code
But I can't reproduce it locally :( |
Just for the record, we did. It was the non JIT VM that had a different definition of longjmp, together with the C11 upgrade. |
Now it compiles in OSX and linuex but not windows:
|
Yes, it seems that |
I think that I could solve the problems, but the CI is not building my last commit:
It filled the disk again? 😞 |
…hod [ newObjectHash ] 20 test cases.
…od [ newObjectHash ] 1/20 Test Cases are NOT EQUIVALENT
Massive ! |
Making C translation available for new Composed image Reader/Writer.
The translation
worksfinishes and generate C code, but there is still some issues:Use(not working on Mac 🍎 💀)sscanf_s
instead ofsnprintf
to avoid overflows,\n
)