Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Remove custom heap #486

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Conversation

josesimoes
Copy link
Contributor

@josesimoes josesimoes commented Aug 5, 2016

  • remove all references and code related with custom heap
  • rework scatter files, AppEntry, FirstEntry and TinyHAL
  • reworked start up files to perform memory initializations
  • clean-up unused code
  • implements Remove "custom heap" #473

I've tested this on real hardware with the Discovery4 solution.
The binaries sizes are: Tinybooter.bin 41372B & ER_FLASH 304880B
I've successfully build the MCBSTM32F400 but can't test it on hardware.
As I'm not entirely confortable nor can test it, I have NOT changed the scatter files and start up assembly code for MDK, only for GCC. Appreciate if someone knowledgeable on that platform could step in and help with that.

Ready for the code review and the criticism. 👷 😓 😄

- remove all references and code related with custom heap
- rework scatter files, AppEntry, FirstEntry and TinyHAL
- reworked startup files to perform memory initializations
- clean-up unused code
@smaillet-ms
Copy link
Member

Please remove the inclusion of additional PRs that makes it impossible to roll back or process PRs independently. Each PR should be isolated and focused on doing one thing that is as small and narrowly defined as possible.

@@ -3,7 +3,7 @@
// <No description>
//
// Microsoft dotNetMF Project
// Copyright �2004 Microsoft Corporation
// Copyright �2004 Microsoft Corporation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not alter copyright comments/notices in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be accurate there is no change in the copyright notice. I haven't changed that obviously.
Being the copyright symbol that is different I would say that GitHub is having problems with the code page of the file it something like that.
But I'll do my best removing that difference from the file.

@josesimoes
Copy link
Contributor Author

Which PR are you referring to?

@@ -16,8 +16,6 @@ static int s_PreHeapInitIndex = 0;

////////////////////////////////////////////////////////////

HAL_DECLARE_CUSTOM_HEAP( CLR_RT_Memory::Allocate, CLR_RT_Memory::Release, CLR_RT_Memory::ReAllocate );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, hold on a sec... This is defining the managed heap APIs. The HAL_DECLARE_CUSTOM_HEAP creates a set of private_xxx APis that are inlined wrappers around the methods listed in the macro. While the entire approach to using a macro like this is dubious at best, we don't want to eliminate the functionality as intended here. The use here is intended to be the managed heap which has lots of internal requirements and assumptions for the collector to work properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you entirely sure about that?!
The name refers to custom heap.
I have build this without this code and it went fine.
I have loaded the image on real hardware a run a test app. Creating and destroying objects. Checked the managed memory going up and down a seeing the GC kicking on. I admit it wasn't nothing fancy or exhaustive but it proved that the managed heap was working.

@smaillet-ms
Copy link
Member

@josesimoes I'm referning to this statement:

NOTE: included workaround for BIG_ENDIAN issue #481
Please don't mix PRs - It's fine to state that one PR has a dependency on another one but don't include the changes for one in another.

@josesimoes
Copy link
Contributor Author

josesimoes commented Aug 8, 2016

I can remove the statement. As for PR #481 it was just merged into the repo, so I guess it wouldn't even allow a merge if I removed the respective changes...

@smaillet-ms
Copy link
Member

Now that it is merged you can re-base so hopefully those changes will disappear and we can focus on the heap specific changes.

@josesimoes
Copy link
Contributor Author

@smaillet-ms done!

@@ -3,7 +3,7 @@
// <No description>
//
// Microsoft dotNetMF Project
// Copyright 2004 Microsoft Corporation
// Copyright ©2004 Microsoft Corporation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smaillet-ms I've replaced this with the correct copyright symbol. Saved the file with UTF-8 encoding and GitHub still shows a difference at this line.
If you really think this deserves the effort let me the encoding for the original code page and I'll try to revert this particular change.

Copy link

@miloush miloush Aug 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josesimoes The original encoding of the file is Windows 1252. (ISO 8859-1 might work too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miloush just saved it again with that encoding and seems to have remove that diff. Thanks for pointing that. 👏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh! :face_palm: Sigh... Thanks for finding this. Unfortunately fixing the encoding on mass is likely to cause more problems than it will help. Given that the current plan on vNext is to start with a clean slate so we can also do code style clean ups as we essentially import code into a new branch we can define and normalize the encoding for each file type. (And ideally find a way to detect deviations before the get into the repo)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was thinking with the vNext in mind whether there is still any tool in the chain that couldn't handle Unicode...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embedded Assemblers? C? C++? Who knows what sort of shortcuts some of the available compilers use. (I can't remember if C++ officially supports Unicode text or even if it makes any mention of encoding of source files in any particular form, EBCDIC anyone? 😁 )

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smaillet-ms EBCDIC I eat that for breakfast, it's my daily job ....

@josesimoes
Copy link
Contributor Author

This solves the need for #492

@smaillet-ms smaillet-ms mentioned this pull request Mar 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants